package com.ruoyi.project.wms.essentials.details.service.impl;

import java.util.List;

import com.ruoyi.project.wms.essentials.details.domain.WmsPurchaseDetails;
import com.ruoyi.project.wms.essentials.details.mapper.WmsPurchaseDetailsMapper;
import com.ruoyi.project.wms.essentials.details.service.IWmsPurchaseDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.text.Convert;

/**
 * 进货订单商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-29
 */
@Service
public class WmsPurchaseDetailsServiceImpl implements IWmsPurchaseDetailsService
{
    @Autowired
    private WmsPurchaseDetailsMapper wmsPurchaseDetailsMapper;

    /**
     * 查询进货订单商品
     * 
     * @param detPurId 进货订单商品ID
     * @return 进货订单商品
     */
    @Override
    public WmsPurchaseDetails selectWmsPurchaseDetailsById(Long detPurId)
    {
        return wmsPurchaseDetailsMapper.selectWmsPurchaseDetailsById(detPurId);
    }

    /**
     * 查询进货订单商品列表
     * 
     * @param wmsPurchaseDetails 进货订单商品
     * @return 进货订单商品
     */
    @Override
    public List<WmsPurchaseDetails> selectWmsPurchaseDetailsList(WmsPurchaseDetails wmsPurchaseDetails)
    {
        return wmsPurchaseDetailsMapper.selectWmsPurchaseDetailsList(wmsPurchaseDetails);
    }

    /**
     * 新增进货订单商品
     * 
     * @param wmsPurchaseDetails 进货订单商品
     * @return 结果
     */
    @Override
    public int insertWmsPurchaseDetails(WmsPurchaseDetails wmsPurchaseDetails)
    {
        return wmsPurchaseDetailsMapper.insertWmsPurchaseDetails(wmsPurchaseDetails);
    }

    /**
     * 修改进货订单商品
     * 
     * @param wmsPurchaseDetails 进货订单商品
     * @return 结果
     */
    @Override
    public int updateWmsPurchaseDetails(WmsPurchaseDetails wmsPurchaseDetails)
    {
        return wmsPurchaseDetailsMapper.updateWmsPurchaseDetails(wmsPurchaseDetails);
    }

    /**
     * 删除进货订单商品对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWmsPurchaseDetailsByIds(String ids)
    {
        return wmsPurchaseDetailsMapper.deleteWmsPurchaseDetailsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除进货订单商品信息
     * 
     * @param detPurId 进货订单商品ID
     * @return 结果
     */
    @Override
    public int deleteWmsPurchaseDetailsById(Long detPurId)
    {
        return wmsPurchaseDetailsMapper.deleteWmsPurchaseDetailsById(detPurId);
    }

    /**
     * 通过id查询订货单详情
     * @param detPurId
     * @return
     */
    @Override
    public List<WmsPurchaseDetails> selectWmsPurchaseDetailsService(Integer detPurId) {
        return wmsPurchaseDetailsMapper.selectWmsPurchaseDetailsMapper(detPurId);
    }
}
